﻿@model PagedIncidentModel
@{
    var grid = new WebGrid(null, rowsPerPage: Model.PageSize,
         ajaxUpdateContainerId: "gridIncidentTable", canPage: true, canSort: true, ajaxUpdateCallback: "preventIncident");
    grid.Bind(Model.Incidents, new[] { "Summury", "Status", "Category", "Impact", "Severity", "Priority", "TicketCreateTime", "TicketResolvedTime", "CloseCode" },
    autoSortAndPage: false, rowCount: int.Parse(Model.TotalRows + ""));
}
<div id="gridIncidentTable">
    @grid.GetHtml(tableStyle: "ContactTB talbe_gray", htmlAttributes: new { width = "100%", border = 0, cellpadding = 0, cellspacing = 0 }, headerStyle: "ContactTH", columns: grid.Columns(
@*alertTalbe.Column("ID", "事件", format: @<text>@item.ID.ToString("0")</text>),*@
grid.Column("Summury", "摘要"),
    grid.Column("Category", "分类"),
    grid.Column("Status", "状态", @<text>@StatusHelper.IncidentStatus(item.Status)</text>),
    grid.Column("Impact", "影响程度", @<text>@StatusHelper.IncidentImpact(item.Impact)</text>),
    grid.Column("Severity", "紧急性", @<text>@StatusHelper.IncidentSeverity(item.Severity)</text>),
    grid.Column("Priority", "优先级", @<text>@StatusHelper.IncidentPriority(item.Priority)</text>),
    grid.Column("TicketCreateTime", "创建时间"),
            grid.Column("TicketResolvedTime", "解决时间", @<text>@DateTimeExtension.ToStringE(item.TicketResolvedTime)</text>),
            grid.Column("CloseCode", "结束代码", @<text>@StatusHelper.IncidentCloseCode(item.CloseCode)</text>)))
    <input type="button" onclick="loadIncidentTable()" value="全部事件刷新" />
</div>
